package com.app.fenak.validation;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ExpressionValidation {
	
	public static String EMAIL_PATTERN = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";

	public static boolean IsMatch(String s, String pattern) {
		try {
			Pattern patt = Pattern.compile(pattern);
			Matcher matcher = patt.matcher(s);
			return matcher.matches();
		} catch (RuntimeException e) {
			return false;
		}
	}

	public static boolean isPasswordValid(String password) {
		return ((password.length() >= 6) && (!password.contains(" ")));
	}

}
